/*
 * 通用app接口
 * 用于整合各种数据
 * @author：黄
 */

// 此处使用elementui的弹框
const Vue = require('vue/dist/vue.js')
const Element = require('element-ui')
const C = require('./common.js')

Vue.use(Element)
Vue.directive('qx', {
    bind: function(el, binding){
        let val = binding.value
        let sto = []
        if (this.localStorage.permission !== 'undefined') {
            sto = JSON.parse(JSON.parse(this.localStorage.permission))
        }
        let empty = false
        sto.forEach( (v) => {
            if (v === val) {
                empty = true
            }
        })
        if (!empty) {
            el.parentNode.removeChild(el)
        }
    }
})


module.exports = {
    Vue: Vue,
    C: C
}